{if $event}
    {literal}
    <style>
    body{background:url({/literal}{$data_path}{literal}b_background.gif)  no-repeat fixed center top #F4F5F6}
</style>
{/literal}
{/if}


{if $is_load_page_first==1}
    {literal}
    <script>
            if(IS_LOGIN){
            jQuery(document).ready(function() {
            fn_new_mes({/literal}{$num_mess},'{$url_root}'{literal});
});
}
</script>
{/literal}
{/if}
<script>
    OID_URL 	= "{$OID_URL}";
    OID_URL_GOG = "{$OID_URL_GOG}";
    {literal}
    function on_change_keyword(e, v){
        if(v.value == ""){
            if(e==1)
            {
                jQuery('#search_keyword').removeClass("fake_keword");
            }
            else{
                jQuery('#search_keyword').addClass("fake_keword");
            }
        }
    }

    function search_submit()
    {
        if(parseInt(jQuery("#search_catid").val()) <= 0)
        {
            alert("Bạn chưa chọn danh mục tìm kiếm!");
            jQuery("#search_catid").focus()
            return false;
        }

        var kw = jQuery.trim( jQuery("#search_keyword").val() );

        if(kw == '')
        {
            alert("Bạn chưa nhập vào từ khóa tìm kiếm!");
            jQuery('#search_keyword').removeClass("fake_keword");
            jQuery("#search_keyword").focus()
            return false;
        }
        else if(parseInt(kw.length) < 3)
        {
            alert("Độ dài từ khóa phải từ 3 ký tự trở lên!");
            jQuery('#search_keyword').removeClass("fake_keword");
            jQuery("#search_keyword").focus()
            return false;
        }

        document.frmSearch.submit();
    }


    var sub_cat_content = '';//sub_cat_bound

    function menu_display(obj, subid, display)
    {
        if(display)//Hiển thị
        {
            if(sub_cat_content == '')
            {
                sub_cat_content = jQuery('#sub_cat_bound').html();

                jQuery('#sub_cat_bound').html('<div style="height:'+jQuery('#sub_cat_bound').height()+'px"></div>');
            }

            jQuery(obj).removeClass('hm_item').addClass('hm_item_hover');

            var left = 4 + jQuery('#top_cat_' + subid).offset().left - jQuery('#h_menu').offset().left;
            jQuery('#h_menu_sub_' + subid).css('left', -left+'px').show();

            jQuery('#h_menu_bottom_' + subid).show();
        }
        else
        {
            if(sub_cat_content != '')
            {
                jQuery('#sub_cat_bound').html(sub_cat_content);
                sub_cat_content = '';
            }

            jQuery(obj).removeClass('hm_item_hover').addClass('hm_item');

            jQuery('#h_menu_sub_' + subid).hide();
            jQuery('#h_menu_bottom_' + subid).hide();
        }
    }

    function menu_hover(obj, display)
    {
        if(display)//Hiển thị
        {
            jQuery(obj).removeClass('hm_item').addClass('hm_item_hover');
        }
        else
        {
            jQuery(obj).removeClass('hm_item_hover').addClass('hm_item');
        }
    }
    {/literal}
</script>
{if $not_error_page}
<div id="header_top">
    <div id="header_center">
        <div class="fl mt10" id="phone_support">
            <div class="text">
                Tư vấn bán hàng online
            </div>
            <div id="phone_no">
                0906 232 111
            </div>
            <div class="c"></div>
        </div>
        {if $OnlineSupport || $is_admin}
            <div class="fl online_support" id="online_support" onmouseover="jQuery('#online_support_header').addClass('os_hover');jQuery('#ol_content').show();" onmouseout="jQuery('#online_support_header').removeClass('os_hover');jQuery('#ol_content').hide();">
                <div id="online_support_header" class="online_support_header">
                    Hỗ trợ trực tuyến {if $is_admin}<br /><a style="color:#fff" onclick="window.open('{$web_dir}online_support_edit.html?is_popup=1' ,'','status=1,toolbar=,scrollbars=1,resizable=,width=1000,height=600,top=' + (screen.height -600)/2 +',left=' + (screen.width -1000)/2 +',location =0,menubar =0');"><b>[ Sửa hỗ trợ online ]</b></a>{/if}
                </div>
                {if $OnlineSupport}
                    <div id="ol_content" class="br3 hide">
                        <div id="ol_arrow"></div>
                        {foreach from=$OnlineSupport item=ogroup}
                            <div class="ol_group_title">{$ogroup.name}</div>
                            <div class="ol_content">
                                <table cellpadding="0" cellspacing="0" width="100%">
                                    {foreach from=$ogroup.users item=user}
                                        <tr>
                                            <td class="ol_name">
                                                {$user.name}:
                                            </td>
                                            <td {if $user.yahoo!=''}class="ol_yahoo"{/if} align="left">
                                                {if $user.yahoo!=''}<a href="ymsgr:sendim?{$user.yahoo}" title="{$user.yahoo}">{$user.yahoo}</a>{/if}
                                            </td>
                                            <td {if $user.skype!=''}class="ol_skype"{/if} align="left">
                                                {if $user.skype!=''}<a href="skype:{$user.skype}?chat" title="{$user.skype}">{$user.skype}</a>{/if}
                                            </td>
                                        </tr>
                                    {/foreach}
                                </table>
                            </div>
                        {/foreach}
                    </div>
                {/if}
            </div>
        {/if}
        <div class="fr" id="header_left_panel">
            <div id="h_lp_top">
                {if $is_login}
                    <div class="user_notify">
                        <a title="Xem tin nhắn" rel="nofollow" href="message.html?ref=top"><img width="16" height="16" src="style/images/comment_email/num_news_email.png" title="Xem tin nhắn" alt="Xem tin nhắn" id="ico-msg"></a>
                        {if $num_mess}
                            <div id="alert-msg">
                                <div class="box-top">
                                    <span><a title="Xem tin nhắn" rel="nofollow" href="message.html?ref=top" style="color:#fff;text-decoration:none"><div id="num_message">{$num_mess}</div></a></span>
                                </div>
                                <div class="arrow-bottom"><img src="style/images201005/alert_arrow.gif" /></div>
                            </div>
                        {/if}
                        |
                        <a href="{$web_dir}{"?page=sign_out"|formatUrl}" rel="nofollow">Thoát </a>
                    </div>
                    <div id="eb_manage" onmouseover="jQuery('#eb_manage_box').show();" onmouseout="jQuery('#eb_manage_box').hide();">
                        <a href="{$web_dir}{"?page=personal"|formatUrl}" rel="nofollow" style="text-decoration:none" title="Trang cá nhân của '{$user_name}'">Chào <span style="color:#FF0">{$user_name}</span></a>
                        <div id="eb_manage_box" align="left">
                            {if $is_admin}
                                <a href="{$web_dir}{"?page=admin"|formatUrl}" rel="nofollow" class="user_menu">Quản trị</a>
                            {/if}
                            {if $is_admin_item && !$is_root}
                                <a href="{$web_dir}{"?page=manage_item"|formatUrl}" rel="nofollow" class="user_menu">Quản trị nội dung</a>
                            {/if}
                            <a href="personal.html" rel="nofollow" class="user_menu">Trang cá nhân</a>
                            <a href="{$web_dir}{$user_name}" class="user_menu">Profile</a>

                            {if $is_root}
                                <a href="{$show_bug_url}" rel="nofollow" class="user_menu" title="{if $DEBUG}Tắt bug{else}Bật bug{/if}">{if $DEBUG}Bug off{else}Show bug{/if}</a>
                                <a href="tools/mem_reset.php?act=clear" rel="nofollow" class="user_menu" title="Mem reset">Mem reset</a>

                                <a href="{$web_dir}{"?page=online"|formatUrl}" rel="nofollow" class="user_menu" title="Người dùng online">Online</a>
                            {/if}
                        </div>
                    </div>
                    {else}
                    <a  href="{$web_dir}{"?page=sign_in&href=$referer_login_url"|formatUrl}" onclick="javascript:login_div();return false;" rel="nofollow">Đăng nhập</a>

                    | <a href="{$web_dir}{"?page=sign_in&cmd=register"|formatUrl}" rel="nofollow">Đăng ký</a>
                {/if}

            </div>
            <div id="h_lp_bottom">
                <a href="{$web_dir}cart.html" id="h_cart_link"  class="fl">
                    <b id="cart_num">0</b> <span>sản phẩm</span>
                </a>

                <div class="sep fl"></div>

                <a href="{$web_dir}cart.html" id="h_cart_pay"  class="fl"></a>
                <div class="c"></div>
            </div>
            <div class="c"></div>
            <div id="h_pl_arr"></div>
        </div>
        <div class="c"></div>
    </div>
</div>
<div id="header">
    <div id='div_admin_config_form' align="left" class='div_admin_config_form' style='position:absolute;display:none'>&nbsp;&nbsp;&nbsp;
        <a href="javascript:void(0);" onClick="openAdminLogo();" title="Config for Logo"><img src="style/images/icon_config.gif" width="19" height="19" class="displayIn"/></a>
        <div style="display:none;width: 600px; margin-top:0px;margin-left:0" id="logo_config" class="TA_Nav box_config">
            <form name="HeaderForm" id="HeaderForm"  method="post"  enctype="multipart/form-data"  >
                <input type="hidden" name="form_block_id" value="{$block_id}">
                <input type="hidden" name="logoID" id="logoID" value="" />
                <input type="hidden" name="logoCmd" id="logoCmd" value="" />
                <div style="border:1px solid #333;padding:10px;">
                    <table>
                        <tr>
                            <td>Ảnh: </td>
                            <td><input type="file" name="uploadLogo" id="uploadLogo" value="" class="textInput" /></td>
                            <td rowspan="3" style="padding-left:10px;"><div id="logoImg"></div></td>
                        </tr>
                        <tr>
                            <td>Tiêu đề: </td>
                            <td><input type="text" name="logoTitle" id="logoTitle" value="" class="textInput" style="width:200px;" /></td>
                        </tr>

                        <tr>
                            <td>Ngày bắt đầu: </td>
                            <td><input type="text" name="logoStartDate" id="logoStartDate" value="" class="textInput" style="width:100px;" /></td>
                        </tr>
                        <tr>
                            <td>Ngày kết thúc: </td>
                            <td><input type="text" name="logoEndDate" id="logoEndDate" value="" class="textInput" style="width:100px;" /></td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align:left;">
                                <input type="checkbox" name="logoActive" id="logoActive" value="1" style="width:auto;" /> Sử dụng logo này
                            </td>
                        </tr>
                    </table>
                    <input type="submit" id="submitLogo" name="submitLogo" value="Lưu lại" />
                </div>
                <div style="margin:10px 0;">
                    <h3>Logo có sẵn</h3>
                    <table style="border:1px solid #333;width:100%;">
                        <tr style="background: #dedede;">
                            <th width="200px">Ảnh</th>
                            <th nowrap>Tiêu đề</th>
                            <th>Ngày<br />bắt đầu</th>
                            <th>Ngày<br />kết thúc</th>
                            <th nowrap>Trạng thái</th>
                            <th></th>
                        </tr>
                        {foreach from=$logos item=usedLogo}
                            <tr>
                                <td>
                                    <img src="{$usedLogo.img_src}" height="56px" /><br />
                                    <input type="hidden" id="hidLogoImg_{$usedLogo.id}" name="hidLogoImg_{$usedLogo.id}" value="{$usedLogo.img_src}" />
                                    <input type="hidden" id="hidLogoTitle_{$usedLogo.id}" name="hidLogoTitle_{$usedLogo.id}" value="{$usedLogo.title}" />
                                    <input type="hidden" id="hidLogoStartDate_{$usedLogo.id}" name="hidLogoStartDate_{$usedLogo.id}" value="{$usedLogo.startDate}" />
                                    <input type="hidden" id="hidLogoEndDate_{$usedLogo.id}" name="hidLogoEndDate_{$usedLogo.id}" value="{$usedLogo.endDate}" />
                                    <input type="hidden" id="hidLogoStatus_{$usedLogo.id}" name="hidLogoStatus_{$usedLogo.id}" value="{$usedLogo.status}" />
                                </td>
                                <td><a style="cursor: pointer;" onclick="LoadLogoConfig({$usedLogo.id})">{$usedLogo.title}</a></td>
                                <td>{$usedLogo.startDate}</td>
                                <td>{$usedLogo.endDate}</td>
                                <td align="center">{$usedLogo.active}</td>
                                <td nowrap>
                                    <a style="cursor: pointer;" onclick="LoadLogoConfig({$usedLogo.id})">Sửa</a>&nbsp;|&nbsp;
                                    <a style="cursor: pointer;" onclick="return CheckDeleteLogo({$usedLogo.id});">Xóa</a>
                                </td>
                            </tr>
                        {/foreach}
                    </table>
                </div>
            </form>
        </div>
    </div>

    <a id="logo" href="{$url_root}" class="fl"><img src="{$logo.img_src}" alt="AzNetGroup.com" title="{$logo.title}" width="172" height="98"/></a>

    <form method="GET" action="{$web_dir}{"?page=sph_search"|formatUrl}" name="frmSearch" id="h_search" class="fl ml5">
        <div class="h_cat_l fl ml5">
            <div class="h_cat_r">
                <div class="h_cat_select">
                    <select name="search_catid" id="search_catid" style="width:156px">
                        {$search_cat_option}
                    </select>
                </div>
            </div>
        </div>
        <div class="h_cat_l fl ml5">
            <div class="h_cat_r">
                <div class="h_cat_select">
                    <input type="text" size="20" name="keywords" id="search_keyword" value="{$keywords}" onclick="on_change_keyword(1,this)" onblur="on_change_keyword(2,this);" {if $keywords==''}class="fake_keword" {/if}/>

                    <input type="button" name="btnSearch" id="search_btn" onclick="search_submit();">
                </div>
            </div>
        </div>
    </form>

    <div class="fr" id="h_link">
    {*<a href="news.html" id="h_news"></a>
  <a id="h_mobile"></a><a id="h_forum"></a>*}

        <a href="bao_gia.html" style="float:right;display:block;margin-top:1px;line-height:normal;height:auto;width:100px;text-align:center" id="btn">Tải báo giá</a>
        <a href="news.html" style="float:right;display:block;margin-top:1px;line-height:normal;height:auto;width:100px;text-align:center" id="btn">Tin tức</a>

        <div class="c"></div>
        <div class="mt5">
            <a href="download.html" style="float:right;display:block;margin-top:1px;line-height:normal;height:auto;width:100px;text-align:center" id="btn" onMouseOver = "showtip('Tải về các tài liệu Hướng dẫn sử dụng, drivers...')" onMouseOut="hidetip()">Download</a>
            <a href="build.html" style="float:right;display:block;margin-top:1px;line-height:normal;height:auto;width:100px;text-align:center" id="btn" onMouseOver = "showtip('Xây dựng cấu hình máy tính theo nhu cầu của bạn!')" onMouseOut="hidetip()">Dựng cấu hình</a>
        </div>
        <div class="c"></div>
    </div>
    <div class="c"></div>
    {if $topcats}
        <div id="h_menu_l">
            <div id="h_menu_r">
                <div id="h_menu">
                    <a href="{$web_dir}" class="home"></a>

                    {foreach from=$topcats item=topcat}
                        <div class="sep fl"></div>
                        <div class="{$topcat.class}" {if (!$topcat.selected || $topcat.selected2) && $topcat.subs}onmouseover="menu_display(this,{$topcat.id},1);" onmouseout="menu_display(this,{$topcat.id},0)"{elseif !$topcat.selected && !$topcat.selected2}onmouseover="menu_hover(this,1);" onmouseout="menu_hover(this,0)"{/if} id="top_cat_{$topcat.id}">
                            <a href="{$topcat.url}" {$topcat.target} {if $topcat.subs}style="padding-right:23px"{/if} class="h_menu_link"><span>{$topcat.name}</span></a>
                            {if $topcat.subs}
                                <span class="hm_arrow"></span>
                                <div class="h_menu_bottom" id="h_menu_bottom_{$topcat.id}" {if $topcat.selected2}style="display:none"{/if}></div>
                            {/if}

                            {if $topcat.subs}
                                <div class="h_menu_sub" id="h_menu_sub_{$topcat.id}"  {if $topcat.selected}style="display:none"{/if}>
                                    <div id="sub_cat_bound_top">
                                        <div id="sub_cat_top"></div>
                                        <div id="sub_cat">
                                            <table cellpadding="0" cellspacing="0" border="0">
                                                <tr>
                                                <td valign="top" width="120">
                                                <div class="sub_cat_list">
                                                    {foreach from=$topcat.subs item=sub name=cat_sub}
                                                        {if $smarty.foreach.cat_sub.iteration>1 && !(($smarty.foreach.cat_sub.iteration-1)%5)}
                                                        </div>
                                                        </td>
                                                        <td valign="top" width="120">
                                                        <div class="sub_cat_list ml10">
                                                        {/if}
                                                        <a href="{$sub.url}" {$sub.class}><span><span>{$sub.name}</span></span></a>
                                                    {/foreach}
                                                </div>
                                                </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div id="sub_cat_bottom"></div>
                                    </div>
                                </div>
                            {/if}
                        </div>
                    {/foreach}
                    <div class="c"></div>
                </div>
            </div>
        </div>

    {/if}
</div>
    {if $subcat_items}
    <div id="sub_cat_bound">
        <div id="sub_cat_top"></div>
        <div id="sub_cat">
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                <td valign="top">
                <div class="sub_cat_list">
                    {foreach from=$subcat_items item=sub name=cat_sub}
                        {if $smarty.foreach.cat_sub.iteration>1 && !(($smarty.foreach.cat_sub.iteration-1) % $max_per_col)}
                        </div>
                        </td>
                        <td valign="top">
                        <div class="sub_cat_list ml10">
                        {/if}
                        <a href="{$sub.url}" {$sub.class}><span><span>{$sub.name}</span></span></a>
                    {/foreach}
                </div>
                </td>
                </tr>
            </table>
        </div>
        <div id="sub_cat_bottom"></div>
    </div>
    {/if}


    {if $is_admin}
    <div align="left" style="width:1000px;margin:5px auto">
        <form name="HeaderForm" id="HeaderForm2"  method="post"  enctype="multipart/form-data"  >
            <input type="hidden" name="form_block_id" value="{$block_id}">
            <div style="cursor:pointer;" onclick="if(document.getElementById('event_config').style.display=='none') document.getElementById('event_config').style.display=''; else document.getElementById('event_config').style.display='none';"><strong>Cấu hình Background Sự kiện</strong></div>
            <div id="event_config" style="display:none;">
                {$msg}
                <table cellpadding="4" cellspacing="0">
                    <tr>
                        <td>
                            Tình trạng:
                        </td>
                        <td>
                            <select name="status"> {$status_option}</select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Upload Body Background:
                        </td>
                        <td>
                            <input type="file" name="b_background"/> <br />
                            <strong>Ảnh (.gif)</strong> kích thước 1600x...
                        </td>
                    </tr>
                    <tr>
                        <td>

                        </td>
                        <td>
                            <input type="submit"  name="submit" value="Cập nhật" style="cursor:pointer"/>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </div>
    {/if}


<script type="text/javascript">CURENT_TOP_CATID = {$CURENT_TOP_CATID};CURENT_LEVEL2_CATID = {$CURENT_LEVEL2_CATID};CURENT_CITY_ID = {$CURENT_CITY_ID};
    {if $ADMIN_LOGO}
        {literal}
        function openAdminLogo()
        {
            if(jQuery('#logo_config').is(':visible'))
            {
                jQuery('#logo_config').hide();
            }
            else
            {
                jQuery('#logo_config').show();
            }

        }

        function LoadLogoConfig(id)
        {
            var configOffset = jQuery('#logo_config').offset();
            jQuery('html, body').animate({scrollTop:configOffset.top});


            window.document.getElementById('logoCmd').value = 'edit';
            window.document.getElementById('logoTitle').value = window.document.getElementById('hidLogoTitle_' + id).value;
            window.document.getElementById('logoID').value = id;
            window.document.getElementById('logoStartDate').value = window.document.getElementById('hidLogoStartDate_' + id).value;
            window.document.getElementById('logoEndDate').value = window.document.getElementById('hidLogoEndDate_' + id).value;
            if(window.document.getElementById('hidLogoStatus_' + id).value == 1) window.document.getElementById('logoActive').checked = true;
            window.document.getElementById('logoImg').innerHTML = '<img src="' + window.document.getElementById('hidLogoImg_' + id).value + '" height="60" />';
        }

        function CheckDeleteLogo(id)
        {
            if(confirm('Are you sure?'))
            {
                window.document.getElementById('logoCmd').value = 'delete';
                window.document.getElementById('logoID').value = id;
                window.document.getElementById('submitLogo').click();

                return true;
            }
            return false;
        }

        jQuery(document).ready(function(){
            jQuery("#logoStartDate").datepicker();
            jQuery("#logoEndDate").datepicker();
        });
        {/literal}
    {/if}
</script>
{/if}